package cn.itcast.bos.service.base.impl;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.itcast.bos.dao.base.CourierDao;
import cn.itcast.bos.domain.base.Courier;
import cn.itcast.bos.service.base.ICourierService;

@Service
@Transactional
public class CourierServiceImpl implements ICourierService {
	
	@Autowired
	private CourierDao courierDao;

	@Override
	public void save(Courier courier) {
		courierDao.save(courier);
		
	}

	@Override
	public Page<Courier> pageQuery(Specification<Courier> specification, Pageable pageable) {
		return courierDao.findAll(specification, pageable);
	}

	@Override
	public void batchHandle(Character deltag, String[] idArr) {
		// 循环作废
		for (String id : idArr) {
			courierDao.delById(Integer.parseInt(id), deltag);
		}
		
	}

}
